package priv.pfz.basedao.query;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * @author yyjxp
 * 2024/2/3 12:09
 */
@Getter
@RequiredArgsConstructor
public enum OpType {
    EQ("=", true),
    NE("!=", false),
    GT(">", false),
    LT("<", false),
    GTE(">=", false),
    LTE("<=", false),
    IS_NULL("IS NULL", false),
    NOT_NULL("IS NOT NULL", false),
    IN("IN", true),
    NOT_IN("NOT IN", false),
    BETWEEN("BETWEEN", false),
    NOT_BETWEEN("NOT BETWEEN", false),
    IS_EMPTY("= ''", false),
    NOT_EMPTY("!= ''", false),
    LIKE("LIKE CONCAT('%', ", ", '%')", false),
    NOT_LIKE("NOT LIKE CONCAT('%', ", ", '%')", false),
    START_WITH("LIKE CONCAT(", ", '%')", false),
    END_WITH("LIKE CONCAT('%', ", ")", false),
    ;

    private final String op;
    private final String op2;
    private final boolean accurate;

    OpType(String op, boolean accurate) {
        this.op = op;
        this.op2 = null;
        this.accurate = accurate;
    }
}
